package com.google.android.material.datepicker;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Arrays;

public final class a implements Parcelable {
    public static final Parcelable.Creator<a> CREATOR = new C0098a();
    /* access modifiers changed from: private */

    /* renamed from: b  reason: collision with root package name */
    public final l f2217b;
    /* access modifiers changed from: private */

    /* renamed from: c  reason: collision with root package name */
    public final l f2218c;
    /* access modifiers changed from: private */

    /* renamed from: d  reason: collision with root package name */
    public final l f2219d;
    /* access modifiers changed from: private */
    public final c e;
    private final int f;
    private final int g;

    /* renamed from: com.google.android.material.datepicker.a$a  reason: collision with other inner class name */
    static class C0098a implements Parcelable.Creator<a> {
        C0098a() {
        }

        /* renamed from: a */
        public a createFromParcel(Parcel parcel) {
            return new a((l) parcel.readParcelable(l.class.getClassLoader()), (l) parcel.readParcelable(l.class.getClassLoader()), (l) parcel.readParcelable(l.class.getClassLoader()), (c) parcel.readParcelable(c.class.getClassLoader()), (C0098a) null);
        }

        /* renamed from: b */
        public a[] newArray(int i) {
            return new a[i];
        }
    }

    public static final class b {
        static final long e = r.a(l.k(1900, 0).h);
        static final long f = r.a(l.k(2100, 11).h);

        /* renamed from: a  reason: collision with root package name */
        private long f2220a = e;

        /* renamed from: b  reason: collision with root package name */
        private long f2221b = f;

        /* renamed from: c  reason: collision with root package name */
        private Long f2222c;

        /* renamed from: d  reason: collision with root package name */
        private c f2223d = f.j(Long.MIN_VALUE);

        b(a aVar) {
            this.f2220a = aVar.f2217b.h;
            this.f2221b = aVar.f2218c.h;
            this.f2222c = Long.valueOf(aVar.f2219d.h);
            this.f2223d = aVar.e;
        }

        public a a() {
            if (this.f2222c == null) {
                long C = i.C();
                if (this.f2220a > C || C > this.f2221b) {
                    C = this.f2220a;
                }
                this.f2222c = Long.valueOf(C);
            }
            Bundle bundle = new Bundle();
            bundle.putParcelable("DEEP_COPY_VALIDATOR_KEY", this.f2223d);
            return new a(l.l(this.f2220a), l.l(this.f2221b), l.l(this.f2222c.longValue()), (c) bundle.getParcelable("DEEP_COPY_VALIDATOR_KEY"), (C0098a) null);
        }

        public b b(long j) {
            this.f2222c = Long.valueOf(j);
            return this;
        }
    }

    public interface c extends Parcelable {
        boolean e(long j);
    }

    private a(l lVar, l lVar2, l lVar3, c cVar) {
        this.f2217b = lVar;
        this.f2218c = lVar2;
        this.f2219d = lVar3;
        this.e = cVar;
        if (lVar.compareTo(lVar3) > 0) {
            throw new IllegalArgumentException("start Month cannot be after current Month");
        } else if (lVar3.compareTo(lVar2) <= 0) {
            this.g = lVar.r(lVar2) + 1;
            this.f = (lVar2.e - lVar.e) + 1;
        } else {
            throw new IllegalArgumentException("current Month cannot be after end Month");
        }
    }

    /* synthetic */ a(l lVar, l lVar2, l lVar3, c cVar, C0098a aVar) {
        this(lVar, lVar2, lVar3, cVar);
    }

    public int describeContents() {
        return 0;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof a)) {
            return false;
        }
        a aVar = (a) obj;
        return this.f2217b.equals(aVar.f2217b) && this.f2218c.equals(aVar.f2218c) && this.f2219d.equals(aVar.f2219d) && this.e.equals(aVar.e);
    }

    public int hashCode() {
        return Arrays.hashCode(new Object[]{this.f2217b, this.f2218c, this.f2219d, this.e});
    }

    public c n() {
        return this.e;
    }

    /* access modifiers changed from: package-private */
    public l o() {
        return this.f2218c;
    }

    /* access modifiers changed from: package-private */
    public int p() {
        return this.g;
    }

    /* access modifiers changed from: package-private */
    public l q() {
        return this.f2219d;
    }

    /* access modifiers changed from: package-private */
    public l r() {
        return this.f2217b;
    }

    /* access modifiers changed from: package-private */
    public int s() {
        return this.f;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeParcelable(this.f2217b, 0);
        parcel.writeParcelable(this.f2218c, 0);
        parcel.writeParcelable(this.f2219d, 0);
        parcel.writeParcelable(this.e, 0);
    }
}
